import { PartialType } from '@nestjs/mapped-types';
import { IsEnum, IsInt, IsNotEmpty, IsOptional, IsUUID } from 'class-validator';
import { Menu, MenuType } from '../entities/menu.entity';

export class SaveMenuDto extends PartialType(Menu) {
  @IsNotEmpty()
  name: string;

  @IsInt()
  @IsNotEmpty()
  order: number;

  @IsNotEmpty()
  path: string;

  @IsUUID()
  @IsOptional()
  parentId?: string;

  @IsOptional()
  icon?: string;

  @IsOptional()
  components?: string;

  @IsOptional()
  @IsEnum(MenuType)
  type?: MenuType;

  @IsUUID()
  @IsOptional()
  id?: string;
}
